package top3.Divorce;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class DivorceGroupingComparator extends WritableComparator {
    protected DivorceGroupingComparator(){
        super(DivorceTop3Bean.class,true);
    }
    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        DivorceTop3Bean aBean = (DivorceTop3Bean) a;
        DivorceTop3Bean bBean = (DivorceTop3Bean) b;
        return aBean.getYears().compareTo(bBean.getYears());
    }
}
